home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
programming
/
mui
/
mcc_tipofday
/
developer
/
autodocs
/
mcc_tipwindow.doc
Wrap
Text File
|
1999-11-30
|
7KB
|
179 lines
TABLE OF CONTENTS
Tipwindow.mcc/Tipwindow.mcc
Tipwindow.mcc/Technical notes
Tipwindow.mcc/MUIA_Tip_FileBase
Tipwindow.mcc/MUIM_Tip_GoHomePage
Tipwindow.mcc/MUIM_Tip_Show
Tipwindow.mcc/Tipwindow.mcc
Many programs on other operating systems often offer so called
"Tip of the day" stickers. It's mostly small window opened on
program startup, showing valuable (more or less) information about
the program, some useful information, keyboard shortcuts or just
neat tips or quick how-to solutions...
I think, that from the user's point of view it's good idea to have
such feature, especially Tips can be turned off if you felt bored.
As you probably guessed, this class is supposed to handle such
tips for your MUI based application. See the enclosed demonstration
for more details.
You like the class? Feel free to use it in your programs.
Tip Of The Day class is freeware software, but it's copyrighted
© 1999 by Marcin Orlowski <carlos@amiga.com.pl>
$Id: MCC_Tipwindow.doc,v 1.6 1999/11/24 22:06:24 carlos Exp $
Tipwindow.mcc/Technical notes
Tips are stored in IFF file. The structure of the file is
rather simple:
chunk 'MAX ' holds total number of tips present in the file
chunks '0000' till 'ffff' (note case IS important!) holds
all the tip texts.
Tips converter takes plain ASCII file as input and writes each
line as separate tip. To support multiline tips, converter handles
all these backslashed (e.g. "\n") characters, and converts them
properly. It also handles hex/dec/oct/bin numbers (e.g. \033), so
you can use all MUI text formatting sequences like \033b to have
text boldfaced, \033u to have it underlined etc.
Since release 15.1, Tipboard supports localized tips. According to
your system settings, the following locations will be checked against
valid tips database
PROGDIR:Tips/$language/filebase.tips
PROGDIR:Catalogs/$language/filebase.tips
LOCALE:Catalogs/$language/filebase.tips
LOCALE:Tips/$language/filebase.tips
LOCALE:$language_filebase.tips
PROGDIR:Tips/$language_filebase.tips
PROGDIR:Tips/english/filebase.tips
PROGDIR:Tips/filebase.tips
PROGDIR:filebase.tips
where $language is your current system language (e.g. "english",
"polski", "deutsch" etc). File base meaning is described in the
MUIA_Tip_FileBase chapter.
Class private data (".tipc" file) is always stored in
PROGDIR:filebase.tipc file
To allow user snapshot the TipOfTheDay window (size/position etc),
the window uses own window ID = 'TODD'. I don't expect it would
ever collide with your application window ID's, but in case
I am wrong, you can always set your own ID at object creation
time to override default one (Tipwindow.mcc is a subclass of
the window class)
Tipwindow.mcc/MUIA_Tip_FileBase
NAME
MUIA_Tip_FileBase -- [ISG], char * v15
FUNCTION
Specifies custom file base (root name) for all Tip related
files this class uses. The file base it copied into
internal buffer (which can hold up to 256 characters).
NOTE:
If you don't specify your own file base, Tip class will
try to find out it by itself, by quering your Applicaiton
object for MUIA_Application_Base, and if fail, for
MUIA_Application_Title. To avoid problems on multiple instances
of your program, the class will strip any dot suffix of your
application base found in range of 4 characters starting
from the end of the name (e.g. "MyApp.3" will result in
"MyApp", but "My.Program" will result in "My.Program").
Unfortunately, MUIA_Application_SingleTask is not gettable
recently, so better don't use dotted base names (e.g. base
name like "My.App" will cause problems as it will be taken
as "My" filebase).
If you need custom value, it appears wise to specify this
attribute on object creation time, and to keep it untouched
later on.
FILES
Tips of the day are stored in the database which name
is built based on the FileBase attribute and the
".tips" suffix. Class settings ("show tips on startup")
and other data are kept in ".tipc" file in your app's home
directory. The ".tipc" file is created when the class is going
to be disposed (OM_DISPOSE), to avoid unnecessary I/O accesses.
But when the state of "show tips on startup" checkmark change
(e.g. due to user's action) the ".tipc" file is written
immidiately.
EXAMPLE
set(obj, MUIA_Tip_FileBase, "myapp");
the class will be then looking for "myapp.tips" database,
and will keep own data in "myapp.tipc" file.
SEE ALSO
See example demo program about class usage
Tipwindow.mcc/MUIM_Tip_GoHomePage
NAME
MUIM_Tip_GoHomePage v15
FUNCTION
If there's OpenURL.library installed and properly
configured, this method should order your favourite
browser to visit TipOfTheDay class' homepage. This method
is called when user click on the bulb image (this is
hidden feature ;-)
EXAMPLE
DoMethod(obj, MUIM_Tip_GoHomePage );
SEE ALSO
Tipwindow.mcc/MUIA_Tip_Show
NAME
MUIM_Tip_Show v15
DoMethod(obj, MUIM_Tip_Show, Flags );
FUNCTION
Shows Tip of the day. If called sequently, will show
next tip each time. Tips never ends (when showing forward,
1st one will be shown after last, or vice versa when showing
tips backwards)
FLAGS
MUIV_Tip_Show_Startup
MUIV_Tip_Show_Next
MUIV_Tip_Show_Prev
MUIV_Tip_Show_Random
NOTE: When MUIV_Tip_Show_Next, Prev or Random are used,
the Tip window will pop up, no matter what the state of
"show tip on startup" is. MUIV_Tip_Show_Startup is
almost the same as MUIV_Tip_Show_Next, but it takes
care of user will (stored in ".tipc" file). It's
recommended to use this flag when you show tips on
startup, but also to have menu item (like "Show tip of
the day...") that will call this method with
MUIV_Tip_Show_Next, to allow user to change his mind
(or to read more tips w/o forcing him to restart your
application which should be totally lame ;-)
EXAMPLE
DoMethod( obj, MUIA_Tip_Show, MUIV_Tip_Show_Startup );
SEE ALSO
See example demo program about class usage